package com.yunxin.zm.service.impl;

import com.yunxin.basis.servlet.impl.BasisServiceImpl;
import com.yunxin.zm.domain.BookDetailEntity;
import com.yunxin.zm.domain.dto.BookDetailDTO;
import com.yunxin.zm.domain.dto.BookTypeDTO;
import com.yunxin.zm.domain.query.BookDetailQuery;
import com.yunxin.zm.domain.save.BookDetailSave;
import com.yunxin.zm.mapper.BookDetailMapper;
import com.yunxin.zm.service.IBookDetailService;
import com.yunxin.zm.service.IBookTypeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
/**
 *Service业务层处理
 * 
 * @author hjl
 * @date Fri Feb 28 13:27:25 CST 2025
 */
@Service
public class BookDetailServiceImpl extends BasisServiceImpl<BookDetailEntity, BookDetailMapper, BookDetailDTO, BookDetailSave, BookDetailQuery> implements IBookDetailService {

   public BookDetailServiceImpl(BookDetailMapper mapper) {super(mapper);}

   @Resource
   private IBookTypeService bookTypeService;

   @Override
   public BookDetailDTO findById(Long id) {
      BookDetailDTO detailDTO = super.findById(id);
      BookTypeDTO typeDTO = bookTypeService.findById(detailDTO.getType());
      detailDTO.setBookTypeDTO(typeDTO);
      return detailDTO;
   }
}
